package com.shanzmoo.platform.manage.api.web.product;


import com.shanzmoo.base.bean.PageRespBase;
import com.shanzmoo.base.bean.SHttpResponse;
import com.shanzmoo.db.module.product.domain.dto.BrandSaveDto;
import com.shanzmoo.db.module.product.domain.dto.ScoreSaveDto;
import com.shanzmoo.db.module.product.domain.dto.ScoreUpdateDto;
import com.shanzmoo.db.module.product.domain.query.ScoreQueryVO;
import com.shanzmoo.db.module.product.domain.vo.CategoryVO;
import com.shanzmoo.db.module.product.domain.vo.ProductScoreVO;
import com.shanzmoo.platform.manage.api.manager.product.ProductScoreManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 商品分类manager
 * @author xueqz
 */
@Api(tags = "商品管理系统-积分商品")
@RestController
@RequestMapping("/api/product/score")
public class ProductScoreController {

    @Autowired
    private ProductScoreManager productScoreManager;

    @ApiOperation(value = "积分商品列表")
    @PostMapping("/getProductScoreList")
    public SHttpResponse<PageRespBase<ProductScoreVO>> getProductScoreList(@RequestBody ScoreQueryVO scoreQueryVO) {

        return productScoreManager.getProductScoreList(scoreQueryVO);
    }


    @ApiOperation(value = "添加积分商品")
    @PostMapping("/addScore")
    public SHttpResponse<Boolean> addScore(@RequestBody ScoreSaveDto scoreSaveDto) {

        return productScoreManager.addScore(scoreSaveDto);
    }

    @ApiOperation(value = "更新积分商品")
    @PostMapping("/updateScore")
    public SHttpResponse<Boolean> updateScore(@RequestBody ScoreUpdateDto scoreUpdateDto) {

        return productScoreManager.updateScore(scoreUpdateDto);
    }

    @ApiOperation(value = "积分商品上下架操作")
    @GetMapping("/operationScore")
    public SHttpResponse<Boolean> operationScore(Integer id,Boolean shelvesMark) {

        return productScoreManager.operationScore(id,shelvesMark);
    }



}
